package com.zucc.core.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zucc.core.dao.ReserDao;
import com.zucc.core.po.MeetingRoom;
import com.zucc.core.po.Reservation;
import com.zucc.core.service.ReserService;


@Service("reserService")
@Transactional
public class ReserServiceImp implements ReserService {
	@Autowired 
	private ReserDao reserDao;
	
	public List<Reservation> findRes(String mName,String date){
		
		return  reserDao.findRes(mName,date);
		
	}

	@Override
	public int deleteRs(Integer id) {
		return reserDao.deleteRs(id);
		
	}
	
	public Reservation getRsById(Integer id) {
		return reserDao.getRsById(id);
	}
	
	public List<Reservation> getRsmById(Integer id) {
		return reserDao.getRsBymId(id);
	}
	
	public int updateRs(Reservation reservation) {
		return reserDao.updateRs(reservation);	
	}
	public  int  createRs(Reservation reservation) {
		return reserDao.createRs(reservation);
	}


	public List<Reservation> findRsmByOpenId(String openId) {
		
		return reserDao.findRsByOpenid(openId);
	}
	 
	public List<Reservation> findRsByDate(String date) {
			
			return reserDao.findRsByDate(date);
		}
	public Reservation findResByresId(Integer id) {
		return reserDao.findRsByrsid(id);
	}
	public int deleteRes(Integer id) {
		return reserDao.deleteRes(id);
	}
	public int selectMRCount(int mRoomId) {
		return reserDao.selectMRCount(mRoomId);
	}
	public List<Integer> selectMRTimeCount(int mRoomId,String date){
		return reserDao.selectMRTimCount(mRoomId, date);
	}
}
